package com.example.manager;

import com.example.controller.request.ProductOrderPageRequest;
import com.example.model.ProductOrderDO;

import java.util.Map;

/**
 * @author yinxin
 * @version 1.0
 * @Description:
 * @date 2022/6/1316:41
 */
public interface ProductOrderManager {

    /**
     * 新增
     * @param productOrderDO
     * @return
     */
    int add(ProductOrderDO productOrderDO);

    /**
     * 通过订单号和账号查询
     * @param outTradeNo
     * @param accountNo
     * @return
     */
    ProductOrderDO findByOutTradeNoAndAccountNo(String outTradeNo,Long accountNo);

    /**
     * 跟新订单状态接口
     * @param outTradeNo
     * @param accountNo
     * @param newState
     * @param oldState
     * @return
     */
    int updateOrderPayState(String outTradeNo,Long accountNo,String newState,String oldState);

    /**
     * 根据状态查看订单分页
     * @param request
     * @return
     */
    Map<String,Object> page(ProductOrderPageRequest request, Long accountNo);
}
